<?php defined('ByShopWWI') or exit('Access Invalid!');?>

<div class="page">
  <div class="fixed-bar">
    <div class="item-title"><a class="back" href="<?php echo getReferer();?>" title="返回列表"><i class="fa fa-arrow-circle-o-left"></i></a>
      <div class="subject">
        <h3><?php echo $lang['adv_index_manage'];?> - 编辑广告“<?php echo $output['adv_list'][0]['adv_title']; ?>” </h3>
        <h5><?php echo $lang['adv_index_manage_subhead'];?></h5>
      </div>
    </div>
  </div>
  <form id="adv_form" enctype="multipart/form-data" method="post" name="advForm">
    <input type="hidden" name="ref_url" value="<?php echo $output['ref_url'];?>" />
    <input type="hidden" name="form_submit" value="ok" />
    <div class="ncap-form-default">
      <!--白银类型-->
      <dl class="row">
        <dt class="tit">
          <label for="name"><em>*</em>请选择白银类型</label>
        </dt>
        <dd class="opt">
          <select name="name" id="name">
            <option value="1#银" <?php if($output['price_record_info']['name']=='1#银'){?>selected="selected"<?php }?>>1#银</option>
            <option value="2#银" <?php if($output['price_record_info']['name']=='2#银'){?>selected="selected"<?php }?>>2#银</option>
            <option value="3#银" <?php if($output['price_record_info']['name']=='3#银'){?>selected="selected"<?php }?>>3#银</option>
          </select>
          <span class="err"></span>
          <p class="notic"></p>
        </dd>
      </dl>
      <!--白银价格-->
      <dl class="row">
        <dt class="tit">
          <label for="average_price"><em>*</em>平均价格(单位:元/千克)</label>
        </dt>
        <dd class="opt">
          <input type="text" name="average_price" id="average_price" class="input-txt" value="<?php echo $output['price_record_info']['average_price'];?>">
          <span class="err"></span>
          <p class="notic"></p>
        </dd>
      </dl>
      <div class="bot"><a href="JavaScript:void(0);" class="ncap-btn-big ncap-btn-green" onclick="document.advForm.submit()"><?php echo $lang['nc_submit'];?></a></div>
    </div>
  </form>
</div>
<script type="text/javascript" src="<?php echo ADMIN_RESOURCE_URL;?>/js/jquery.nyroModal.js"></script>

<script type="text/javascript">
$(function(){
	// 点击查看图片
	$('.nyroModal').nyroModal();
	
    $('#adv_start_date').datepicker({dateFormat: 'yy-mm-dd'});
    $('#adv_end_date').datepicker({dateFormat: 'yy-mm-dd'});

	var textButton="<input type='text' name='textfield' id='textfield1' class='type-file-text' /><input type='button' name='button' id='button1' value='选择上传...' class='type-file-button' />"
    $(textButton).insertBefore("#file_adv_pic");
    $("#file_adv_pic").change(function(){
	$("#textfield1").val($("#file_adv_pic").val());
    });

	var textButton="<input type='text' name='textfield' id='textfield3' class='type-file-text' /><input type='button' name='button' id='button3' value='选择上传...' class='type-file-button' />"
    $(textButton).insertBefore("#file_flash_swf");
    $("#file_flash_swf").change(function(){
	$("#textfield3").val($("#file_flash_swf").val());
    });
});
</script>